#include "gtest/gtest.h"

#define private public
#define protected public

#include <iostream>
#include "cpptemp.hh"

using namespace mtool;


class Cpptemp_unittest:public testing::Test{
	


} ;


TEST_F(Cpptemp_unittest, test1) {
 mtool::auto_data data;
 data["age"] = 10;
 data["name"] = "xu";
 std::string str = "name:{$name}, age:{$age}";
 std::string ret = mtool::parse(str, data);  // ret will be "name:xu, age:10"
 EXPECT_STREQ(ret.c_str(),"name:xu, age:10");

 

}

TEST_F(Cpptemp_unittest, test2) {
 mtool::auto_data data;
 std::string str = "name:{$hostname}";
 std::string ret = mtool::parse(str, data);  // ret will be "name:xu, age:10"
 EXPECT_STREQ(ret.c_str(),"name:haha");


}
